import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/ruoyi";

// 分页查询用户列表
export function listUser(query) {
  return request({
    url: "/system/user/list",
    method: "get",
    params: query,
  });
}

// 新增用户
export function addUser(data) {
  return request({
    url: "/system/user/add",
    method: "post",
    data: data,
  });
}
// 查询用户详细
export function getUser(userId) {
  return request({
    url: "/system/user/" + parseStrEmpty(userId),
    method: "get",
  });
}

// 编辑用户
export function updateUser(data) {
  return request({
    url: "/system/user/edit",
    method: "put",
    data: data,
  });
}
// 删除用户
export function delUser(userId) {
  return request({
    url: "/system/user/" + userId,
    method: "delete",
  });
}
